package com.guigui.gulimall.order.config;

import com.guigui.gulimall.order.interceptor.GulimallAuthInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {

    @Autowired
    private GulimallAuthInterceptor gulimallAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(gulimallAuthInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/order/order/**")
                .excludePathPatterns("/order/alipay/**");
    }
}
